@extends('default.layouts.adminPublic')
@section('title', '编辑权限')

@section('content')
        <!--导航开始-->
<div class="crumb_warp">
    <i class="fa fa-home"></i> <a href="{{url('admin')}}">首页</a> &raquo; 权限管理
</div>
<!--导航结束-->

<!--结果集标题与导航组件 开始-->
<div class="result_wrap">
    <div class="result_title">
        <h3>修改权限</h3>
        @if(count($errors)>0)
            <div class="mark">
                @if(is_object($errors))
                    @foreach($errors->all() as $error)
                        <p>{{$error}}</p>
                    @endforeach
                @else
                    <p>{{$errors}}</p>
                @endif
            </div>
        @endif
    </div>
    <div class="result_content">
        <div class="short_wrap">
            <a href="{{url('admin/permission/create')}}"><i class="fa fa-plus"></i>添加权限</a>
            <a href="{{url('admin/permission')}}"><i class="fa fa-recycle"></i>权限列表</a>
        </div>
    </div>
</div>
<!--结果集标题与导航组件 结束-->

<div class="result_wrap">
    <form action="{{url('admin/permission/'.$currPermission->id)}}" method="post" name="permissionForm"
          id="permissionForm" onsubmit="return checkForm('#permissionForm')">
        <input type="hidden" name="_method" value="put">
        {{csrf_field()}}
        <table class="add_tab">
            <tbody>
            <tr>
                <th width="120">所属权限组：</th>
                <td>
                    <select name="fid" id="fid" style="width:200px;">
                        <option value="0">--顶级权限--</option>
                        @foreach($permission as $v)
                            <option value="{{$v['id']}}">{{$v['display_name']}}</option>
                        @endforeach
                    </select>
                    <script>document.getElementById('fid').value = '{{$currPermission->fid}}';</script>
                </td>
            </tr>
            <tr>
                <th><i class="require">*</i> 权限标识：</th>
                <td>
                    <input type="text" class="lg" name="name" value="{{ $currPermission->name }}">
                </td>
            </tr>
            <tr>
                <th><i class="require">*</i> 权限名称：</th>
                <td>
                    <input type="text" class="lg" name="display_name" value="{{ $currPermission->display_name }}">
                </td>
            </tr>
            <tr>
                <th><i class="require">*</i> 权限描述：</th>
                <td>
                    <input type="text" class="lg" name="description" value="{{ $currPermission->description }}">
                </td>
            </tr>

            <tr>
                <th>权限排序：</th>
                <td>
                    <input type="text" class="lg" name="sort" value="{{ $currPermission->sort }}">
                </td>
            </tr>

            <tr>
                <th></th>
                <td>
                    <img src="" alt="" id="art_thumb_img" style="max-width: 350px; max-height:100px;">
                </td>
            </tr>

            <tr>
                <th></th>
                <td>
                    <input type="submit" value="提交">
                    <input type="button" class="back" onclick="history.go(-1)" value="返回">
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
@endsection
